
from pyglet.gl import GLfloat

from os import path

def vec(*args):
    return (GLfloat * len(args))(*args)

def tuple_f(chaine):
    return tuple(float(e) for e in chaine.split()) 

def getVal(attrs, fconv, nom,defaut):
    if attrs.has_key(nom):
        return fconv(attrs[nom])
    else:
        return defaut
   
_data_path_base = path.join(path.dirname(__file__), "..", "data")

def data_path(concat=None):
    if concat:
        return path.join(_data_path_base, concat)
    else:
        return _data_path_base

